package com.yanggu.scala.chapater11.parallel

object ParallelDemo01 {

  def main(args: Array[String]): Unit = {
    val result1 = (0 to 100).map(_ => Thread.currentThread().getName).distinct
    val result2 = (0 to 100).par.map(_ => Thread.currentThread().getName).distinct

    //非并行打印
    println(result1)
    println("----------------并行输出---------------------")
    //并行打印
    println(result2)
  }

}
